# -*- coding: utf-8 -*-
# @Author  : longbhu
# @Time    : 2025/5/27 14:04
# @Function:
from calc_v1.utils import load_parameters_from_json, extract_codes


eco_type_json_path = r"F:\code\dev\calc-gep-regulate-cqc\calc_v1\data\ecosystems_json\ecosystems_type_GB.json"
# 读取 JSON 数据
ecosystem_json = load_parameters_from_json(eco_type_json_path)

# 为每个一级生态系统生成Code列表
ecosystem_codes = {}
for ecosystem in ecosystem_json["applicable_ecosystems"]:
    name = ecosystem["name"]
    codes = extract_codes(ecosystem)
    ecosystem_codes[name] = codes

print(ecosystem_codes)